(global.webpackJsonp = global.webpackJsonp || []).push([
  ["wjyk_recycle/pages/confirm-order/confirm-order"], {
    "0b73": function (e, t, n) {
      n.r(t);
      var o, r = n("ca19"),
        a = n("8258");
      for (o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
          return a[e];
        });
      }(o);
      n("3450");
      var i = n("f0c5"),
        r = Object(i.a)(a.default, r.b, r.c, !1, null, null, null, !1, r.a, void 0);
      t.default = r.exports;
    },
    3450: function (e, t, n) {
      var o = n("37f9");
      n.n(o).a;
    },
    "37f9": function (e, t, n) {},
    "3e5e": function (e, n, o) {
      (function (i) {
        Object.defineProperty(n, "__esModule", {
          value: !0
        }), n.default = void 0;
        var e, s = (e = o("4795")) && e.__esModule ? e : {
          default: e
        };

        function u(e, t, n, o, r, a, i) {
          try {
            var s = e[a](i),
              u = s.value;
          } catch (e) {
            return n(e), 0;
          }
          s.done ? t(u) : Promise.resolve(u).then(o, r);
        }

        function c(s) {
          return function () {
            var e = this,
              i = arguments;
            return new Promise(function (t, n) {
              var o = s.apply(e, i);

              function r(e) {
                u(o, t, n, r, a, "next", e);
              }

              function a(e) {
                u(o, t, n, r, a, "throw", e);
              }
              r(void 0);
            });
          };
        }
        var t = {
          data: function () {
            return {
              pic_url: this.$imgUrl,
              options: {},
              user: {},
              goodsInfo: {},
              aa: "display: none;",
              unit: "",
              number: 1,
              total: 0,
              remark: "",
              payment_type: null,
              price: 0,
              agreeFlag: 0,
              showPrice: 0
            };
          },
          onShow: function () {
            this.number = 1, this.settlementInfo(), this.unit = i.getStorageSync("name");
          },
          onLoad: function (e) {
            this.options = e, console.log("options", e);
          },
          methods: {
            isAgree: function (e, t) {
              this.agreeFlag = e, 0 == this.agreeFlag && 1 == this.number && (this.showPrice = this.price - Number(this.goodsInfo.deduction_money)),
                0 == this.agreeFlag && 1 != this.number && (this.price = this.number * t), 0 != this.agreeFlag && 1 == this.number && (this.showPrice = this.price),
                0 != this.agreeFlag && 1 != this.number && (this.price = this.number * t), console.log("aaaaaaaaaa", this.showPrice, this.price);
            },
            settlementInfo: function () {
              var n = this;
              return c(s.default.mark(function e() {
                var t;
                return s.default.wrap(function (e) {
                  for (;;) switch (e.prev = e.next) {
                    case 0:
                      return e.next = 2, n.$http({
                        url: n.$api.settlement,
                        data: {
                          uid: i.getStorageSync("uid"),
                          goodsid: n.options.goodsid
                        }
                      });

                    case 2:
                      0 == (t = e.sent).errno && (n.user = t.data.user, n.goodsInfo = t.data.goods, n.payment_type = t.data.goods.payment_type,
                        1 == t.data.goods.payment_type && (n.total = t.data.goods.integral), 1 != t.data.goods.payment_type && (n.price = t.data.goods.price,
                          n.showPrice = n.price - n.goodsInfo.deduction_money), console.log("立即兑换", t, n.user));

                    case 4:
                    case "end":
                      return e.stop();
                  }
                }, e);
              }))();
            },
            personMessage: function () {
              i.navigateTo({
                url: "../person-message/person-message"
              });
            },
            confirmExchange: function (n, o, r) {
              // debugger
              var a = this;
              return c(s.default.mark(function e() {
                var t;
                return s.default.wrap(function (e) {
                  for (;;) switch (e.prev = e.next) {
                    case 0:
                      t = 1 == a.payment_type ? "" : 2 == a.payment_type && 0 == a.agreeFlag ? a.price - a.goodsInfo.deduction_money : a.price,
                        console.log("total", a.price, n, o, r, a.user.province), null == a.user.province || "" == a.user.province ? i.showToast({
                          title: "请先去完善个人资料",
                          duration: 1e3,
                          icon: "none"
                        }) : (0 == o || "0.00" == o || Number(o) < Number(n)) && 1 == a.payment_type ? a.$sun.toast(a.unit + "不足") : 1 == a.payment_type ? a.addOrders() : 0 == t || "0.00" == t ? (a.addOrders(),
                          console.log("111111111")) : (console.log("22222222222222"), a.wxPay());
                          // debugger
                    case 3:
                    case "end":
                      return e.stop();
                  }
                }, e);
              }))();
            },
            addOrders: function () {
              var o = this;
              return c(s.default.mark(function e() {
                var t, n;
                return s.default.wrap(function (e) {
                  for (;;) switch (e.prev = e.next) {
                    case 0:
                      return n = 1 == o.payment_type ? o.total : 2 == o.payment_type && 0 == o.agreeFlag ? o.goodsInfo.deduction_integral : "",
                        t = 1 == o.payment_type ? "" : 2 == o.payment_type && 0 == o.agreeFlag ? o.price - o.goodsInfo.deduction_money : o.price,
                        console.log("actualTotal", n), e.next = 5, o.$http({
                          url: o.$api.addOrder,
                          data: {
                            uid: i.getStorageSync("uid"),
                            goodsid: o.options.goodsid,
                            count: o.number,
                            payment_type: 0 == o.agreeFlag && 1 != o.payment_type ? 2 : o.payment_type,
                            integral: n,
                            price: Number(t).toFixed(2),
                            total: Number(n).toFixed(2),
                            remark: o.remark,
                            exchange: 0 == o.agreeFlag ? o.goodsInfo.exchange : 0
                          }
                        });

                    case 5:
                      0 == (n = e.sent).errno && (console.log("点击确认兑换", n), o.aa = "display:block;", setTimeout(function () {
                        console.log("跳转至我的", i.getStorageSync("tabIndex")), i.reLaunch({
                          url: "../my/my?index=" + i.getStorageSync("tabIndex")
                        });
                      }, 1e3));

                    case 7:
                    case "end":
                      return e.stop();
                  }
                }, e);
              }))();
            },
            wxPay: function () {
              var n = this;
              return c(s.default.mark(function e() {
                var t;
                return s.default.wrap(function (e) {
                  for (;;) switch (e.prev = e.next) {
                    case 0:
                      return t = 1 == n.payment_type ? "" : 2 == n.payment_type && 0 == n.agreeFlag ? n.price - n.goodsInfo.deduction_money : n.price,
                        e.next = 3, n.$http({
                          url: n.$api.pay,
                          show: !0,
                          method: "post",
                          data: {
                            openid: i.getStorageSync("openid"),
                            money: Number(t).toFixed(2)
                          }
                        });

                    case 3:
                      t = e.sent, console.log("微信支付", t), 0 == t.errno && i.requestPayment({
                        provider: "wxpay",
                        timeStamp: t.data.timeStamp,
                        nonceStr: t.data.nonceStr,
                        package: t.data.package,
                        signType: t.data.signType,
                        paySign: t.data.paySign,
                        out_trade_no: t.data.out_trade_no,
                        success: function () {
                          var t = c(s.default.mark(function e(t) {
                            return s.default.wrap(function (e) {
                              for (;;) switch (e.prev = e.next) {
                                case 0:
                                  n.addOrders();

                                case 1:
                                case "end":
                                  return e.stop();
                              }
                            }, e);
                          }));
                          return function (e) {
                            return t.apply(this, arguments);
                          };
                        }(),
                        fail: function (e) {
                          console.log(JSON.stringify(e)), n.$sun.toast("取消支付");
                        }
                      });

                    case 6:
                    case "end":
                      return e.stop();
                  }
                }, e);
              }))();
            },
            reduce: function (e, t, n) {
              1 < e && (this.number = e - 1, 1 == this.payment_type && (this.total = (this.number * Number(t)).toFixed(2)),
                  2 == this.payment_type && (this.total = (this.number * Number(t)).toFixed(2), this.price = (this.number * Number(n)).toFixed(2)),
                  3 == this.payment_type && (this.price = (this.number * Number(n)).toFixed(2))),
                console.log("点击减号", e, Number(n), this.number, this.total);
            },
            add: function (e, t, n) {
              this.number = e + 1, 1 == this.payment_type && (this.total = (this.number * Number(t)).toFixed(2)),
                2 == this.payment_type && (this.total = (this.number * Number(t)).toFixed(2), this.price = (this.number * Number(n)).toFixed(2)),
                3 == this.payment_type && (this.price = (this.number * Number(n)).toFixed(2)), console.log("点击加号", e, Number(n), this.number, this.total);
            },
            jump: function () {
              i.reLaunch({
                url: "../my/my"
              });
            }
          }
        };
        n.default = t;
      }).call(this, o("543d").default);
    },
    "799e": function (e, t, n) {
      (function (e) {
        function t(e) {
          return e && e.__esModule ? e : {
            default: e
          };
        }
        n("8163"), t(n("66fd")), e(t(n("0b73")).default);
      }).call(this, n("543d").createPage);
    },
    8258: function (e, t, n) {
      n.r(t);
      var o, r = n("3e5e"),
        a = n.n(r);
      for (o in r) "default" !== o && function (e) {
        n.d(t, e, function () {
          return r[e];
        });
      }(o);
      t.default = a.a;
    },
    ca19: function (e, t, n) {
      function o() {
        var e = this,
          t = (e.$createElement, e._self._c, e.showPrice.toFixed(2)),
          n = (e.price - e.goodsInfo.deduction_money).toFixed(2),
          o = e.showPrice.toFixed(2),
          r = (e.price - e.goodsInfo.deduction_money).toFixed(2);
        e.$mp.data = Object.assign({}, {
          $root: {
            g0: t,
            g1: n,
            g2: o,
            g3: r
          }
        });
      }
      var r = [];
      n.d(t, "b", function () {
        return o;
      }), n.d(t, "c", function () {
        return r;
      }), n.d(t, "a", function () {});
    }
  },
  [
    ["799e", "common/runtime", "common/vendor"]
  ]
]);